(function(window, document) {
    angular
        .module('app')
        .controller('accountListController', accountListController);

    accountListController.$inject = [
        'accountListFactory',
        'uidFactory',
        '$cookies'
    ];

    function accountListController(accountListFactory, uidFactory, $cookies) {
        var vm = this;
        var uid = uidFactory.getUid() || 1;

        // 设置uid
        accountListFactory.setUid(uid);

        // 获得数据
        accountListFactory.accountListPromise().then(function(data) {
            if (data.returncode === 0) {
                vm.list = data.list;
            } else {
                alert('系统维护升级中！');
            }
        }, function(err) {
            alert(err);
        });
    }
})(window, document);
